<!DOCTYPE html>
<html>
<head>
<title>企业资料</title>
#parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
		<div class="grid-btn">
			<div class="form-group col-sm-2">
				<input id="keyword" type="text" maxlength="25" class="form-control" v-model="q.shopName" @keyup.enter="query" placeholder="企业名称，只能输入中英文或数字" onkeyup="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')">
			</div>
			<a class="btn btn-default" @click="query">查询</a>
			
			
			#if($shiro.hasPermission("merchantinfo:save"))
			<a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			#end
			#if($shiro.hasPermission("merchantinfo:update"))
			<a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			#end
			#if($shiro.hasPermission("merchantinfo:review"))
			<a class="btn btn-primary" @click="review"><i class="fa fa-pencil-square-o"></i>&nbsp;审核</a>
			#end
			#if($shiro.hasPermission("merchantinfo:uploadLogo"))
			<a class="btn btn-primary" @click="upLogo"><i class=""></i>&nbsp;上传logo</a>
			#end
			#if($shiro.hasPermission("merchantinfo:saveSonMerchant"))
			<a class="btn btn-primary" @click="addSonMerchant"><i class="fa fa-plus"></i>&nbsp;新增子商户</a>
			#end
			<a class="btn btn-primary" onclick="viewInfo()"><i class=""></i>&nbsp;查看</a>
			#if($shiro.hasPermission("merchantinfo:dataDoZip"))
			<a class="btn btn-primary" @click="dataDoZip"><i class=""></i>&nbsp;进件资料下载</a>
			#end
			#if($shiro.hasPermission("merchantinfo:delete"))
			<a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;注销</a>
			#end
			#if($shiro.hasPermission("merchantinfo:frozen"))
			<a class="btn btn-primary" @click="frozen"><i class="fa fa-pencil-square-o"></i>&nbsp;冻结</a>
			#end
			#if($shiro.hasPermission("merchantinfo:unFrozen"))
			<a class="btn btn-primary" @click="unFrozen"><i class="fa fa-pencil-square-o"></i>&nbsp;解冻</a>
			#end
		</div>
	    <table id="jqGrid"></table>
	    <div id="jqGridPager"></div>
    </div>
    
    <div v-show="!showList" class="panel panel-default" id="edit">
    	<div id="formDiv">
		<div class="panel-heading">{{title}}</div>
		<form class="form-horizontal">
			<!-- <div class="form-group">
			   	<div class="col-sm-2 control-label">微信id</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" disabled="disabled" v-model="merchantInfo.openid" placeholder="企业的微信id"/>
			    </div>
			</div> -->
			
			<div class="form-group">
			   	<div class="col-sm-2 control-label">企业名称</div>
			   	<div class="col-sm-10">
			      <input id="input_shopname" type="text" class="form-control"  maxlength="30" v-model="merchantInfo.shopName" placeholder="企业名称，只能输入中英文、数字" onkeyup="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')"/>
			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">企业简称</div>
			   	<div class="col-sm-10">
			      <input id="input_shopAbbreviation" type="text" class="form-control" maxlength="20" v-model="merchantInfo.shopAbbreviation" placeholder="企业简称，只能是中英文、数字" onkeyup="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')"/>
			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">企业地址</div>
			   	<div class="col-sm-10">
			      <input id="input_shopAddress" type="text" class="form-control" maxlength="60" v-model="merchantInfo.shopAddress" placeholder="企业地址，只能输入中英文和数字" onkeyup="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')"/>
			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">客服电话</div>
			   	<div class="col-sm-10">
			      <input id="input_telephone" type="text" class="form-control" maxlength="15" v-model="merchantInfo.telephone" placeholder="客服电话" onkeyup="value=value.replace(/[^0-9\-]/g,'')"/>
			    </div>
			</div>
			
			<div class="form-group">
			   	<div class="col-sm-2 control-label">联系人</div>
			   	<div class="col-sm-10">
			      <input id="input_username" type="text" class="form-control" maxlength="11"  v-model="merchantInfo.username" placeholder="联系人，只能输入中英文" onkeyup="value=value.replace(/[^\a-\z\A-\Z\u4E00-\u9FA5]/g,'')"/>
			    </div>
			</div> 
			<div class="form-group">
			   	<div class="col-sm-2 control-label">联系人电话</div>
			   	<div class="col-sm-10">
			      <input id="input_mobilephone" type="text" class="form-control" maxlength="11" v-model="merchantInfo.mobilephone" placeholder="联系人电话" onblur="ismobile()" onkeyup="value=value.replace(/[^0-9]/g,'')" onchange="checkMobile(this.value)" maxlength="11"/>
			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">联系人邮箱</div>
			   	<div class="col-sm-10">
			      <input id="input_email" type="text" class="form-control" maxlength="30" v-model="merchantInfo.email" placeholder="联系人邮箱" onblur="isemail()" onkeyup="value=value.replace(/[^\a-\z\A-\Z0-9\@\_\-\.]/g,'')"/>
			    </div>
			</div>
			
			
			<div class="form-group">
			   	<div class="col-sm-2 control-label">法人姓名</div>
			   	<div class="col-sm-10">
			      <input id="input_legalName" type="text" class="form-control" maxlength="10"  v-model="merchantInfo.legalName" placeholder="法人姓名，只能输入中英文" onkeyup="value=value.replace(/[^\a-\z\A-\Z\u4E00-\u9FA5]/g,'')"/>
			    </div>
			</div> 
			<div class="form-group">
			   	<div class="col-sm-2 control-label">法人身份证号码</div>
			   	<div class="col-sm-10">
			      <input id="input_idCard" type="text" class="form-control" maxlength="18" v-model="merchantInfo.idCard" placeholder="法人身份证号码，只能输入数字" onkeyup="value=value.replace(/[^0-9]/g,'')" />
			    </div>
			</div>
			
			
			<div class="form-group">
			   	<div class="col-sm-2 control-label">结算账户户名</div>
			   	<div class="col-sm-10">
			      <input id="input_bankUser" type="text" class="form-control" maxlength="10"  v-model="merchantInfo.bankUser" placeholder="结算账户户名，只能输入中英文" onkeyup="value=value.replace(/[^\a-\z\A-\Z\u4E00-\u9FA5]/g,'')"/>
			    </div>
			</div> 
			<div class="form-group">
			   	<div class="col-sm-2 control-label">结算账户开户行（精确到支行）</div>
			   	<div class="col-sm-10">
			      <input id="input_bankName" type="text" class="form-control" maxlength="30" v-model="merchantInfo.bankName" placeholder="结算账户开户行，只能输入中文" onkeyup="value=value.replace(/[^\u4E00-\u9FA5]/g,'')"/>
			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">结算账号</div>
			   	<div class="col-sm-10">
			      <input id="input_bankCard" type="text" class="form-control" maxlength="20"  v-model="merchantInfo.bankCard" placeholder="结算账号，只能输入数字" onkeyup="value=value.replace(/[^0-9]/g,'')" />
			    </div>
			</div> 
			
			<div id="upDiv" style="display: none">
				<div class="form-group" >
				   	<div class="col-sm-2 control-label">营业执照</div>
				   	<div class="col-sm-10">
					   	 <div class="form-group" id="uploadForm" enctype="multipart/form-data">
			                <div>营业执照</div>
			                <div class="fileinput fileinput-new" data-provides="fileinput" id="exampleInputUpload">
			                    <div class="fileinput-new thumbnail" style="width: 200px;height: auto;max-height:150px;">
			                        <img id="picImg" style="width: 100%;height: auto;max-height: 140px;" :src="merchantInfo.businessLicenseImg" alt="">
			                    </div>
			                    <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;"></div>
			                    <div>
			                        <span class="btn btn-primary btn-file">
			                            <span class="fileinput-new">选择文件</span>
			                            <span class="fileinput-exists">换一张</span>
			                            <input type="file" name="businessLicenseImg" id="businessLicenseImg" accept="image/gif,image/jpeg,image/x-png">
			                        </span>
			                        <a type="button"  class="btn btn-info" onclick="imgSubmit('businessLicenseImg','1');">上传</a>
			                    </div>
			                  
			                </div>
			            </div>
				    </div>
				</div>
			
			
				<div class="form-group" >
				   	<div class="col-sm-2 control-label">法人身份证</div>
				   	<div class="col-sm-10">
					   	 <div class="form-group" id="uploadForm" enctype="multipart/form-data">
			                <div >正面</div>
			                <div class="fileinput fileinput-new" data-provides="fileinput" id="exampleInputUpload">
			                    <div class="fileinput-new thumbnail" style="width: 200px;height: auto;max-height:150px;">
			                        <img id="picImg" style="width: 100%;height: auto;max-height: 140px;" :src="merchantInfo.positiveImg" alt="">
			                    </div>
			                    <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;"></div>
			                    <div>
			                        <span class="btn btn-primary btn-file">
			                            <span class="fileinput-new">选择文件</span>
			                            <span class="fileinput-exists">换一张</span>
			                            <input type="file" name="positiveImg" id="positiveImg" accept="image/gif,image/jpeg,image/x-png">
			                        </span>
			                        <a type="button" id="positiveSubmit" class="btn btn-info" onclick="imgSubmit('positiveImg','1');">上传</a>
			                    </div>
			                  
			                </div>
			            </div>
			            <div class="form-group" id="uploadForm" enctype="multipart/form-data">
			                <div >反面</div>
			                <div class="fileinput fileinput-new" data-provides="fileinput" id="exampleInputUpload">
			                    <div class="fileinput-new thumbnail" style="width: 200px;height: auto;max-height:150px;">
			                        <img id="picImg" style="width: 100%;height: auto;max-height: 140px;" :src="merchantInfo.oppositeImg" alt="">
			                    </div>
			                    <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;"></div>
			                    <div>
			                        <span class="btn btn-primary btn-file">
			                            <span class="fileinput-new">选择文件</span>
			                            <span class="fileinput-exists">换一张</span>
			                            <input type="file" name="oppositeImg" id="oppositeImg" accept="image/gif,image/jpeg,image/x-png">
			                        </span>
			                        <a type="button" id="oppositeSubmit" class="btn btn-info" onclick="imgSubmit('oppositeImg','1');">上传</a>
			                    </div>
			                </div>
			            </div>
				    </div>
				</div>
				
				
				<div class="form-group" >
				   	<div class="col-sm-2 control-label">银行开户许可证</div>
				   	<div class="col-sm-10">
					   	 <div class="form-group" id="uploadForm" enctype="multipart/form-data">
			                <div>银行开户许可证</div>
			                <div class="fileinput fileinput-new" data-provides="fileinput" id="exampleInputUpload">
			                    <div class="fileinput-new thumbnail" style="width: 200px;height: auto;max-height:150px;">
			                        <img id="picImg" style="width: 100%;height: auto;max-height: 140px;" :src="merchantInfo.bankLicenseImg" alt="">
			                    </div>
			                    <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;"></div>
			                    <div>
			                        <span class="btn btn-primary btn-file">
			                            <span class="fileinput-new">选择文件</span>
			                            <span class="fileinput-exists">换一张</span>
			                            <input type="file" name="bankLicenseImg" id="bankLicenseImg" accept="image/gif,image/jpeg,image/x-png">
			                        </span>
			                        <a type="button"  class="btn btn-info" onclick="imgSubmit('bankLicenseImg','1');">上传</a>
			                    </div>
			                </div>
			            </div>
				    </div>
				</div>
				
				
				
				<div class="form-group" >
					<div class="col-sm-2 control-label"  >结算类型</div>
					对私结算<input name="jiesuan" type="radio" value="1" onclick="setType(this.value);" checked="checked">&nbsp;&nbsp;
					对公结算<input name="jiesuan" type="radio" value="2" onclick="setType(this.value);" >
				   
				   	<div class="col-sm-10" style="margin-top: 20px;">
				   	
				   		<div id="settlementType1" style="display: block;">
						   	<div class="form-group" id="uploadForm" enctype="multipart/form-data">
				                <div>结算授权书</div>
				                <div class="fileinput fileinput-new" data-provides="fileinput" id="exampleInputUpload">
				                    <div class="fileinput-new thumbnail" style="width: 200px;height: auto;max-height:150px;">
				                        <img id="picImg" style="width: 100%;height: auto;max-height: 140px;" :src="merchantInfo.settlementBookImg" alt="">
				                    </div>
				                    <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;"></div>
				                    <div>
				                        <span class="btn btn-primary btn-file">
				                            <span class="fileinput-new">选择文件</span>
				                            <span class="fileinput-exists">换一张</span>
				                            <input type="file" name="settlementBookImg" id="settlementBookImg" accept="image/gif,image/jpeg,image/x-png">
				                        </span>
				                        <a type="button"  class="btn btn-info" onclick="imgSubmit('settlementBookImg','1');">上传</a>
				                    </div>
				                </div>
				            </div>
				            <div class="form-group" id="uploadForm" enctype="multipart/form-data">
				                <div>结算人身份证正面</div>
				                <div class="fileinput fileinput-new" data-provides="fileinput" id="exampleInputUpload">
				                    <div class="fileinput-new thumbnail" style="width: 200px;height: auto;max-height:150px;">
				                        <img id="picImg" style="width: 100%;height: auto;max-height: 140px;" :src="merchantInfo.settleUserPositiveImg" alt="">
				                    </div>
				                    <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;"></div>
				                    <div>
				                        <span class="btn btn-primary btn-file">
				                            <span class="fileinput-new">选择文件</span>
				                            <span class="fileinput-exists">换一张</span>
				                            <input type="file" name="settleUserPositiveImg" id="settleUserPositiveImg" accept="image/gif,image/jpeg,image/x-png">
				                        </span>
				                        <a type="button"  class="btn btn-info" onclick="imgSubmit('settleUserPositiveImg','1');">上传</a>
				                    </div>
				                </div>
				            </div>
				            <div class="form-group" id="uploadForm" enctype="multipart/form-data">
				                <div>结算人身份证反面</div>
				                <div class="fileinput fileinput-new" data-provides="fileinput" id="exampleInputUpload">
				                    <div class="fileinput-new thumbnail" style="width: 200px;height: auto;max-height:150px;">
				                        <img id="picImg" style="width: 100%;height: auto;max-height: 140px;" :src="merchantInfo.settleUserOppositeImg" alt="">
				                    </div>
				                    <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;"></div>
				                    <div>
				                        <span class="btn btn-primary btn-file">
				                            <span class="fileinput-new">选择文件</span>
				                            <span class="fileinput-exists">换一张</span>
				                            <input type="file" name="settleUserOppositeImg" id="settleUserOppositeImg" accept="image/gif,image/jpeg,image/x-png">
				                        </span>
				                        <a type="button"  class="btn btn-info" onclick="imgSubmit('settleUserOppositeImg','1');">上传</a>
				                    </div>
				                </div>
				            </div>
				            <div class="form-group" id="uploadForm" enctype="multipart/form-data">
				                <div>结算人银行卡正面</div>
				                <div class="fileinput fileinput-new" data-provides="fileinput" id="exampleInputUpload">
				                    <div class="fileinput-new thumbnail" style="width: 200px;height: auto;max-height:150px;">
				                        <img id="picImg" style="width: 100%;height: auto;max-height: 140px;" :src="merchantInfo.settleBankPositiveImg" alt="">
				                    </div>
				                    <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;"></div>
				                    <div>
				                        <span class="btn btn-primary btn-file">
				                            <span class="fileinput-new">选择文件</span>
				                            <span class="fileinput-exists">换一张</span>
				                            <input type="file" name="settleBankPositiveImg" id="settleBankPositiveImg" accept="image/gif,image/jpeg,image/x-png">
				                        </span>
				                        <a type="button"  class="btn btn-info" onclick="imgSubmit('settleBankPositiveImg','1');">上传</a>
				                    </div>
				                </div>
				            </div>
				            <div class="form-group" id="uploadForm" enctype="multipart/form-data">
				                <div>结算人银行卡反面</div>
				                <div class="fileinput fileinput-new" data-provides="fileinput" id="exampleInputUpload">
				                    <div class="fileinput-new thumbnail" style="width: 200px;height: auto;max-height:150px;">
				                        <img id="picImg" style="width: 100%;height: auto;max-height: 140px;" :src="merchantInfo.settleBankOppositeImg" alt="">
				                    </div>
				                    <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;"></div>
				                    <div>
				                        <span class="btn btn-primary btn-file">
				                            <span class="fileinput-new">选择文件</span>
				                            <span class="fileinput-exists">换一张</span>
				                            <input type="file" name="settleBankOppositeImg" id="settleBankOppositeImg" accept="image/gif,image/jpeg,image/x-png">
				                        </span>
				                        <a type="button" class="btn btn-info" onclick="imgSubmit('settleBankOppositeImg','1');">上传</a>
				                    </div>
				                </div>
				            </div>
			            </div>
			            
			            
			            <div id="settlementType2" style="display: none;">
				            <div class="form-group" id="uploadForm" enctype="multipart/form-data">
				                <div>开立单位银行结算账户申请书或印鉴卡</div>
				                <div class="fileinput fileinput-new" data-provides="fileinput" id="exampleInputUpload">
				                    <div class="fileinput-new thumbnail" style="width: 200px;height: auto;max-height:150px;">
				                        <img id="picImg" style="width: 100%;height: auto;max-height: 140px;" :src="merchantInfo.sealCardImg" alt="">
				                    </div>
				                    <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;"></div>
				                    <div>
				                        <span class="btn btn-primary btn-file">
				                            <span class="fileinput-new">选择文件</span>
				                            <span class="fileinput-exists">换一张</span>
				                            <input type="file" name="sealCardImg" id="sealCardImg" accept="image/gif,image/jpeg,image/x-png">
				                        </span>
				                        <a type="button"  class="btn btn-info" onclick="imgSubmit('sealCardImg','1');">上传</a>
				                    </div>
				                </div>
				            </div>
			            </div>
				    </div>
				    
				</div>
				
				<div class="form-group" >
				   	<div class="col-sm-2 control-label">实体门店企业照片</div>
				   	<div class="col-sm-10">
				      	<div class="form-group" id="uploadForm" enctype="multipart/form-data">
			                <div >门头照</div>
			                <div class="fileinput fileinput-new" data-provides="fileinput" id="exampleInputUpload">
			                    <div class="fileinput-new thumbnail" style="width: 200px;height: auto;max-height:150px;">
			                        <img id="picImg" style="width: 100%;height: auto;max-height: 140px;" :src="merchantInfo.outerImg" alt="">
			                    </div>
			                    <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;"></div>
			                    <div>
			                        <span class="btn btn-primary btn-file">
			                            <span class="fileinput-new">选择文件</span>
			                            <span class="fileinput-exists">换一张</span>
			                            <input type="file" name="outerImg" id="outerImg" accept="image/gif,image/jpeg,image/x-png">
			                        </span>
			                        <a type="button" id="positiveSubmit" class="btn btn-info" onclick="imgSubmit('outerImg','1');">上传</a>
			                    </div>
			                  
			                </div>
			            </div>
			            <!-- <div class="form-group" id="uploadForm" enctype="multipart/form-data">
			                <div >门头照2</div>
			                <div class="fileinput fileinput-new" data-provides="fileinput" id="exampleInputUpload">
			                    <div class="fileinput-new thumbnail" style="width: 200px;height: auto;max-height:150px;">
			                        <img id="picImg" style="width: 100%;height: auto;max-height: 140px;" :src="merchantInfo.doorHeadImg" alt="">
			                    </div>
			                    <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;"></div>
			                    <div>
			                        <span class="btn btn-primary btn-file">
			                            <span class="fileinput-new">选择文件</span>
			                            <span class="fileinput-exists">换一张</span>
			                            <input type="file" name="doorHeadImg" id="doorHeadImg" accept="image/gif,image/jpeg,image/x-png">
			                        </span>
			                        <a type="button" id="positiveSubmit" class="btn btn-info" onclick="imgSubmit('doorHeadImg','1');">上传</a>
			                    </div>
			                  
			                </div>
			            </div>
			            <div class="form-group" id="uploadForm" enctype="multipart/form-data">
			                <div >内景照</div>
			                <div class="fileinput fileinput-new" data-provides="fileinput" id="exampleInputUpload">
			                    <div class="fileinput-new thumbnail" style="width: 200px;height: auto;max-height:150px;">
			                        <img id="picImg" style="width: 100%;height: auto;max-height: 140px;" :src="merchantInfo.innerImg" alt="">
			                    </div>
			                    <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;"></div>
			                    <div>
			                        <span class="btn btn-primary btn-file">
			                            <span class="fileinput-new">选择文件</span>
			                            <span class="fileinput-exists">换一张</span>
			                            <input type="file" name="innerImg" id="innerImg" accept="image/gif,image/jpeg,image/x-png">
			                        </span>
			                        <a type="button" id="positiveSubmit" class="btn btn-info" onclick="imgSubmit('innerImg','1');">上传</a>
			                    </div>
			                  
			                </div>
			            </div> -->
			            
			            <div class="form-group" >
				            <div style="color: red;">（以上资料如是复印件，则需加盖鲜章后扫描或拍照上传）</div>
				        </div>
			            
				    </div>
				</div>
			</div>
			
			
			<div class="form-group">
				<div class="col-sm-2 control-label"></div> 
				<input type="button" id="subButton" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
				&nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
			</div>
		</form>
		</div>
		
		<div id="logoDiv" style="display: none;">
		<div class="panel-heading">{{title}}</div>
		<form class="form-horizontal">
			<div class="form-group">
			   	<div class="col-sm-2 control-label">姓名</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control"  v-model="merchantInfo.username" disabled="disabled"/>
			    </div>
			</div> 
			<div class="form-group">
			   	<div class="col-sm-2 control-label">联系人电话</div>
			   	<div class="col-sm-10">
			      <input type="tel" class="form-control" v-model="merchantInfo.mobilephone" disabled="disabled"/>
			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">企业名</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="merchantInfo.shopName" disabled="disabled"/>
			    </div>
			</div>
			
			<div class="form-group" id="uploadForm" enctype="multipart/form-data">
				<div class="col-sm-2 control-label">上传logo</div>
                <div class="fileinput fileinput-new" data-provides="fileinput" id="exampleInputUpload">
                    <div class="fileinput-new thumbnail" style="width: 250px;height: auto;max-height:150px;">
                        <img id="picImg" style="width: 100%;height: auto;max-height: 140px;" :src="merchantInfo.logo" alt="">
                    </div>
                    <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 250px; max-height: 150px;"></div>
                    <div  style="max-width: 600px; max-height: 150px;margin-top: 5px;margin-bottom: 5px;">
                    	<font style="color: red;font-size: 12px;">*图片尺寸在300x70  到  400x150之间  或150x180  到  250x250之间<br>
                    	</font>
                    </div>
                    <div >
                        <span class="btn btn-primary btn-file">
                            <span class="fileinput-new">选择文件</span>
                            <span class="fileinput-exists">换一张</span>
                            <input type="file" name="logo" id="logo" accept="image/gif,image/jpeg,image/x-png" onchange="logoChange(this)">
                        </span>&nbsp;&nbsp;
                        <button type="button" id="logoSubmit" class="btn btn-info" onclick="imgSubmit('logo','2');">上传</button>
                        	&nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
                    </div>
                </div>
            </div>
			<!--<div class="form-group">
				<div class="col-sm-2 control-label"></div> 
				 <input type="button" class="btn btn-primary" @click="saveChannel" value="确定"/> 
				&nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
			</div>
			-->
		</form>
		</div>
	</div>
	
</div>

<script src="${rc.contextPath}/js/merchant/merchantinfo.js?_${date.systemTime}"></script>
<script type="text/javascript">
    function isemail(){
        var emailReg=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
        var email = $("#input_email").val().trim();
        if(emailReg.test(email) == false && email.length > 0){
            alert("邮箱格式有误，请重新输入");
            return false;
        }
        return true;
    }

    function ismobile() {
        var mobileReg = /^1[3456789]\d{9}$/;
        var mobile = $("#input_mobilephone").val().trim();
        if (mobileReg.test(mobile) == false && mobile.length > 0) {
            alert("手机号输入有误，请重新输入");
            return false;
        }
        return true;
    }
</script>
<script type="text/javascript">

	function viewImg(url){
		if(url != null && url !=''){
			parent.layer.open({
				  type: 2,
				  title: '图片预览',
				  shadeClose: true,
				  shade: 0.8,
				  area: ['60%', '80%'],
				  content: url //iframe的url
				}); 
		}
	}
	
	function setType(value){
		if(value == 1){
			$('#settlementType1').show();
			$('#settlementType2').hide();
		}else if(value == 2){
			$('#settlementType2').show();
			$('#settlementType1').hide();
		}
	}
	
	function checkMobile(mobile){
		$.ajax({
	    	type: "POST",
		    url: "../merchantinfo/checkMobile",
		    data: JSON.stringify(mobile),
		    success: function(r){
		    	if(r.code != 0){
		    		alert(r.msg, function(index){
		    			$('#subButton').attr('disabled',true); 
						return;
					});
		    	}else if(r.code == 0){
		    		$('#subButton').removeAttr("disabled"); 
		    	}
		    	
			}
		});
	}
	
	function viewInfo(){
		if(url != null && url !=''){
			var id = getSelectedRow();
			if(id == null){
				return ;
			}
			rowData = $('#jqGrid').jqGrid('getRowData',id);
			var sealCardImg = rowData.sealCardImg;
			if(sealCardImg == '' || sealCardImg == null){
				parent.layer.open({
					  type: 2,
					  title: '企业信息',
					  shadeClose: true,
					  shade: 0.8,
					  fixed: false, //不固定
					  maxmin: true,
					  area: ['80%', '80%'],
					  content: 'merchant/view.html?id='+id //iframe的url
					});
			}else{
				parent.layer.open({
					  type: 2,
					  title: '企业信息',
					  shadeClose: true,
					  shade: 0.8,
					  fixed: false, //不固定
					  maxmin: true,
					  area: ['80%', '80%'],
					  content: 'merchant/view2.html?id='+id //iframe的url
					});
			}
		}
	}
	
	function logoChange(val) {
        var file = document.getElementById(val.id);
        createReader(file.files[0], function (width, height) {
        	//alert(width + ' '+ height + ' ---'+ file.files[0].size)
        	if(width - height >= 200 && (300 <= width  <= 400) && (70 <= height <= 150)){
        		$('#logoSubmit').attr("disabled",false); 
        	}else if(height -  width<= 100 &&  (180 <= width  <= 250) && (150 <= height <= 250)){
        		$('#logoSubmit').attr("disabled",false); 
        	}else{
        		alert('图片尺寸有误,请重新选择图片上传');
        		$('#logoSubmit').attr("disabled",true); 
        	}
        });
	}
	
	createReader = function(file, whenReady) {
        var reader = new FileReader;
        reader.onload = function (evt) {
            var image = new Image();
            image.onload = function () {
                var width = this.width;
                var height = this.height;
                if (whenReady) whenReady(width, height);
            };
            image.src = evt.target.result;
        };
        reader.readAsDataURL(file);
    }
	
	// 身份证正面照
	function imgSubmit(imginput,type){
	   
       var data = new FormData();
       var file = $("#"+imginput)[0].files[0];
       if(file == null){
    	   return alert('请选择一个图片上传');
       }
       //console.log(file)
       data.append('file',file);    //将文件转成二进制形式
       data.append("id",vm.merchantInfo.merchantId);
       data.append("imginput",imginput);
       $.ajax({
            url: '../merchantinfo/fileUpload',
            type: 'POST',
            data: data,
            async: false,
            cache: false,
            contentType: false,
            processData: false,
            success: function (r) {
                //console.log(r);
                if(r.code == 0){
                	if(type == 1){
                		alert('上传成功');
                	}else if(type == 2){
                		alert('上传成功', function(index){
    						vm.reload();
    					});
                	}
				}else{
					alert('数据异常...');
				}
            },
            error: function (r) {
            	alert('数据异常...');
            }
        });
	}
	
</script>
</body>
</html>